package com.keyin.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.webkit.WebView;

public class ImageWebView extends WebView {
	Context context;
	GestureDetector gd;

	public ImageWebView(Context context) {
		this(context, null);
	}
	
	public ImageWebView(Context context, AttributeSet attribute) {
		super(context, attribute);
		
		getSettings().setJavaScriptEnabled(true);
		getSettings().setSupportZoom(true);
		getSettings().setBuiltInZoomControls(true);

		this.context = context;
		gd = new GestureDetector(context, sogl);
	}

	GestureDetector.SimpleOnGestureListener sogl = new GestureDetector.SimpleOnGestureListener() {
		public boolean onDown(MotionEvent event) {
			Log.d("--------", "onDown");
			return false;
		}

		public boolean onFling(MotionEvent event1, MotionEvent event2,
				float velocityX, float velocityY) {
			Log.d("--------", "onFling");
			if (event1.getRawX() > event2.getRawX()) {
			} else {
			}
			return true;
		}
	};
}
